/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "observation_task")
@NamedQueries({
    @NamedQuery(name = "ObservationTask.findAll", query = "SELECT o FROM ObservationTask o")})
public class ObservationTask implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Id    
    @Basic(optional = false)
    @Column(name = "observation_task_id")
    private String observationTaskId;
    
    @Column(name = "seq")
    private String seq;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "observation_id")
    private Observation observation;
    
    @Column(name = "title")
    private String title;
    @Column(name = "detail")
    private String detail;
    @Column(name = "info")
    private String info;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "observation_folder_id")
    private Folder folder;
    
     @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "severity_code_id")
    private SeverityCode severity;
    
    @Column(name = "severity_day_count")
    private Integer severityDayCount;
    
    @Column(name = "severity_day_add")
    private Integer severityDayAdd;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "status_remarks")
    private StatusRemarkCode statusRemarks;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "status_remarks_tmp")
    private StatusRemarkCode statusRemarksTemp;
    
    @Column(name = "remarks")
    private String maRemarks;
    
    @Column(name = "remarks_tmp")
    private String maRemarksTemp;
    
    @Column(name = "obs_sts_ma")
   private String statusSubmitMa; 
    
    @Column(name = "obs_sts_sp")
    private String statusSubmitSuper; 
    
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "action_plan_folder_id")
    private Folder actionPlasFolder;
    
    @Column(name = "action_plan_summary")
    private String summary;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "action_plan_folder_id_tmp")
    private Folder actionPlasFolderTemp;
    
    @Column(name = "action_plan_summary_tmp")
    private String summaryTemp;
    
    @Embedded
    private InfoAudit infoAudit;
    
    @OneToMany (mappedBy = "observationTask" , fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    private List<ObservationHistoryTask> historyList;

    public ObservationTask() {
    }

    public ObservationTask(String observationTaskId) {
        this.observationTaskId = observationTaskId;
    }

    public String getObservationTaskId() {
        return observationTaskId;
    }

    public void setObservationTaskId(String observationTaskId) {
        this.observationTaskId = observationTaskId;
    }

    public String getSeq() {
        return seq;
    }

    public void setSeq(String seq) {
        this.seq = seq;
    }

    public Observation getObservation() {
        return observation;
    }

    public void setObservation(Observation observation) {
        this.observation = observation;
    }

  
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public Folder getFolder() {
        return folder;
    }

    public void setFolder(Folder folder) {
        this.folder = folder;
    }
    
    public SeverityCode getSeverity() {
        return severity;
    }

    public void setSeverity(SeverityCode severity) {
        this.severity = severity;
    }    

    public Integer getSeverityDayCount() {
        return severityDayCount;
    }

    public void setSeverityDayCount(Integer severityDayCount) {
        this.severityDayCount = severityDayCount;
    }

    public Integer getSeverityDayAdd() {
        return severityDayAdd;
    }

    public void setSeverityDayAdd(Integer severityDayAdd) {
        this.severityDayAdd = severityDayAdd;
    }

    public StatusRemarkCode getStatusRemarks() {
        return statusRemarks;
    }

    public void setStatusRemarks(StatusRemarkCode statusRemarks) {
        this.statusRemarks = statusRemarks;
    }

    public Folder getActionPlasFolder() {
        return actionPlasFolder;
    }

    public void setActionPlasFolder(Folder actionPlasFolder) {
        this.actionPlasFolder = actionPlasFolder;
    }

    public String getMaRemarks() {
        return maRemarks;
    }

    public void setMaRemarks(String maRemarks) {
        this.maRemarks = maRemarks;
    }

    public String getSummary() {
        return summary;
    }
    
     public String getStatusSubmitMa() {
        return statusSubmitMa;
    }

    public void setStatusSubmitMa(String statusSubmitMa) {
        this.statusSubmitMa = statusSubmitMa;
    }

    public String getStatusSubmitSuper() {
        return statusSubmitSuper;
    }

    public void setStatusSubmitSuper(String statusSubmitSuper) {
        this.statusSubmitSuper = statusSubmitSuper;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public StatusRemarkCode getStatusRemarksTemp() {
        return statusRemarksTemp;
    }

    public void setStatusRemarksTemp(StatusRemarkCode statusRemarksTemp) {
        this.statusRemarksTemp = statusRemarksTemp;
    }

    public String getMaRemarksTemp() {
        return maRemarksTemp;
    }

    public void setMaRemarksTemp(String maRemarksTemp) {
        this.maRemarksTemp = maRemarksTemp;
    }

    public Folder getActionPlasFolderTemp() {
        return actionPlasFolderTemp;
    }

    public void setActionPlasFolderTemp(Folder actionPlasFolderTemp) {
        this.actionPlasFolderTemp = actionPlasFolderTemp;
    }

    public String getSummaryTemp() {
        return summaryTemp;
    }

    public void setSummaryTemp(String summaryTemp) {
        this.summaryTemp = summaryTemp;
    }

    public List<ObservationHistoryTask> getHistoryList() {
        return historyList;
    }

    public void setHistoryList(List<ObservationHistoryTask> historyList) {
        this.historyList = historyList;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (observationTaskId != null ? observationTaskId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ObservationTask)) {
            return false;
        }
        ObservationTask other = (ObservationTask) object;
        if ((this.observationTaskId == null && other.observationTaskId != null) || (this.observationTaskId != null && !this.observationTaskId.equals(other.observationTaskId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "exatrez.model.ObservationTask[ observationTaskId=" + observationTaskId + " ]";
    }
    
}
